package com.itheima.health.dao;

import com.itheima.health.pojo.Order;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 预约DAO
 */
public interface OrderDao {

    /* 添加订单 */
    void save(@Param("order") Order order);

    /* 查询今日订单 */
    Order getOrderByToday(@Param("memId") Integer id, @Param("date") String date);


    Integer findOrderCountAfterDate(String thisWeekMonday);

    Integer findVisitsCountByDate(String today);

    Integer findVisitsCountAfterDate(String thisWeekMonday);

    List<Map> findHotSetmeal();

    Integer findOrderCountByDate(String today);

    /* 判断该用户该日是否预约过此套餐 */
    Order findSetmealByDate(@Param("memberId") Integer id,
                            @Param("date") Date date,
                            @Param("setmealId") Integer setmealId);

    /* 添加订单 */
    void addOrder(@Param("order") Order order);


    /**
     * 分组聚合查热门套餐，value版本
     * @return
     */
    List<Map> selectHotsetmealsValue();

    /**
     * 查询预约详情
     * @param id
     * @return
     */
    Map<String, Object> selectDetailById(@Param("id") Integer id);

    Integer getSetmealCountBySetmealName(@Param("name") String setmealName);
}
